import React from 'react';
import { Value, Editor } from '@design/core';
import ReactPlugin from './plugins';

export { Value };

const DesktopEditor = React.forwardRef((props, ref) => {
  const { plugins = [], toolbox = [], ...restProps } = props;
  const plugin = ReactPlugin({ plugins, toolbox });
  return <Editor ref={ref} {...restProps} plugins={plugin} />;
});

export default React.memo(DesktopEditor);
